package se.topshelf.golftracker.core.domain;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 *
 */
public enum ClubType {
    DRIVER("Driver", "D"), WOOD_2("2 Wood", "2W"), SPOON("Spoon/3 Wood", "3W"), WOOD_4("4 Wood", "4W"),
    WOOD_5("5 Wood", "5W"), WOOD_6("6 Wood", "6W"), WOOD_7("7 Wood", "7W"),
    RESCUE_1("1 Rescue", "1Rs"), RESCUE_2("2 Rescue", "2Rs"), RESCUE_3("3 Rescue", "3Rs"),
    RESCUE_4("4 Rescue", "4Rs"), RESCUE_5("5 Rescue", "5Rs"),
    HYBRID_2("2 Hybrid", "2Hy"), HYBRID_3("3 Hybrid", "3Hy"), HYBRID_4("4 Hybrid", "4Hy"), HYBRID_5("5 hybrid", "5Hy"),
    HYBRID_6("6 Hybrid", "6Hy"), HYBRID_7("7 Hybrid", "7Hy"), HYBRID_8("8 Hybrid", "8Hy"), HYBRID_9("9 Hybrid", "9Hy"),
    IRON_1("1 Iron", "1I"), IRON_2("2 Iron", "2I"), IRON_3("3 Iron", "3I"), IRON_4("4 iron", "4I"), IRON_5("5 Iron", "5I"),
    IRON_6("6 Iron", "6I"), IRON_7("7 Iron", "7I"), IRON_8("8 Iron", "8i"), IRON_9("9 Iron", "9I"),
    PITCH_WEDGE("Pitch Wedge", "PW"), GAP_WEDGE("Gap Wedge", "GW"), SAND_WEDGE("Sand Wedge", "SW"),
    LOB_WEDGE("Lob Wedge", "LW"),
    CHIPPER("Chipper", "Chp"),
    PUTTER("Putter", "Pt");

    private static ClubType[] woods = new ClubType[]{DRIVER, WOOD_2, SPOON, WOOD_4, WOOD_5, WOOD_6, WOOD_7};
    private static ClubType[] rescues = new ClubType[]{RESCUE_1, RESCUE_2, RESCUE_3, RESCUE_4, RESCUE_5};
    private static ClubType[] hybrids = new ClubType[]{HYBRID_2, HYBRID_3, HYBRID_4, HYBRID_5, HYBRID_6, HYBRID_7, HYBRID_8, HYBRID_9};
    private static ClubType[] irons = new ClubType[]{IRON_1, IRON_2, IRON_3, IRON_4, IRON_5, IRON_6, IRON_7, IRON_8, IRON_9};
    private static ClubType[] wedges = new ClubType[]{PITCH_WEDGE, GAP_WEDGE, SAND_WEDGE, LOB_WEDGE};

    ClubType(String name, String shortName) {
        this.name = name;
        this.shortName = shortName;
    }

    private String name;
    private String shortName;

    public String getName() {
        return name;
    }

    public String getShortName() {
        return shortName;
    }

    public List<ClubType> getWoods() {
        return Collections.unmodifiableList(Arrays.asList(woods));
    }

    public List<ClubType> getRescues() {
        return Collections.unmodifiableList(Arrays.asList(rescues));
    }

    public List<ClubType> getHybrids() {
        return Collections.unmodifiableList(Arrays.asList(hybrids));
    }

    public List<ClubType> getIrons() {
        return Collections.unmodifiableList(Arrays.asList(irons));
    }

    public List<ClubType> getWedges() {
        return Collections.unmodifiableList(Arrays.asList(wedges));
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("ClubType");
        sb.append("{name='").append(name).append('\'');
        sb.append(", shortName='").append(shortName).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
